package engine.groups
{
	import engine.utils.DisplayUtils;
	
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	
	public class DisplayGroup extends Group
	{
		private var _groupContainer:DisplayObjectContainer;
		
		public function DisplayGroup(container:DisplayObjectContainer, parent:Group)
		{
			super(parent);
			
			this._groupContainer = new Sprite();
			this._groupContainer.mouseEnabled = false;
			this._groupContainer.name = this.name + "Container";
			container.addChild(this._groupContainer);
		}
		
		override public function destroy():void
		{
			super.destroy();
			
			DisplayUtils.destroy(this._groupContainer);
			this._groupContainer = null;
		}
		
		public function get groupContainer():DisplayObjectContainer { return this._groupContainer; }
	}
}